package com.xique.door.project.miniprogram.controller;

import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.project.miniprogram.service.IMiniInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/** 富文本 */
@RestController
@RequestMapping("/mini/information")
public class MiniInformationContorller {

  @Autowired private IMiniInformationService miniInformationService;

  /** 富文本列表 */
  @GetMapping("/getList")
  public AjaxResult getMiniInformationList(
      String informationType, Integer pageNum, Integer pageSize) {
    pageNum = pageNum != null ? pageNum : 1;
    pageSize = pageSize != null ? pageSize : 10;
    return AjaxResult.success(
        miniInformationService.getInformationList(informationType, pageNum, pageSize));
  }

//  /** 富文本列表 */
//  @GetMapping("/getList")
//  public AjaxResult getMiniInformationList(
//          String informationType) {
//    return AjaxResult.success(miniInformationService.getInformationList(informationType));
//  }

  /** 富文本详情 */
  @GetMapping("/getDetails")
  public AjaxResult getInformation(Long id){
    return miniInformationService.getInformation(id);
  }
}
